home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / System 7.0 Samples / CShell⁄THINK C / Start.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-20  |  1.5 KB  |  61 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** Program:          CShell
  5. ** File:             start.c
  6. ** Originally from:  Traffic Light 2.0 (2.0 version by Keith Rollin)
  7. ** Modified by:      Eric Soldan
  8. **
  9. ** Copyright © 1989-1991 Apple Computer, Inc.
  10. ** All rights reserved.
  11. */
  12.  
  13.  
  14.  
  15. /*****************************************************************************/
  16.  
  17.  
  18.  
  19. #include "CShell.h"                /* Get the CShell includes/typedefs, etc.    */
  20. #include "CShellCommon.h"        /* Get the stuff in common with rez.        */
  21. #include "CShell.protos"        /* Get the prototypes for CShell.            */
  22.  
  23.  
  24.  
  25. /*****************************************************************************/
  26.  
  27.  
  28.  
  29. extern void _DataInit();
  30.  
  31.  
  32.  
  33. /*****************************************************************************/
  34. /*****************************************************************************/
  35.  
  36.  
  37.  
  38. #pragma segment Main
  39. void    main(void)
  40. {
  41.     #ifndef THINK_C
  42.     UnloadSeg((Ptr)_DataInit);        /* Note that _DataInit can't be in Main! */
  43.     #endif
  44.     
  45.     /*     If you have stack requirements that differ from the default, then you
  46.     ** could use SetApplLimit to increase StackSpace at this point, before
  47.     ** calling MaxApplZone.
  48.     */
  49.  
  50.     MaxApplZone();    /*     Expand the heap so code segments load at the top. */
  51.     Initialize();        /* Initialize the program. */
  52.     StartDocuments();    /* Open (or print) designated documents. */
  53.  
  54.     UnloadSeg((Ptr)Initialize);        /* Initialize can't be in Main! */
  55.     EventLoop();                    /* Call the main event loop. */
  56.     ExitToShell();                    /* Quit the application. */
  57. }
  58.  
  59.  
  60.  
  61.